﻿using System.ComponentModel;
using Flux.Data.Maps;

namespace Flux.Editor.ViewModels.PropertyViewModels
{
	public class MapPropertyViewModel
		: PropertyViewModel<Map>
	{
		[Category("General")]
		[DisplayName(@"Name")]
		[Description("The maps name")]
		public string Name
		{
			get { return DataContext.Name; }
			set
			{
				DataContext.Name = value;
				NotifyPropertyChanged();
			}
		}

		[Category("Appearence")]
		[DisplayName(@"Width")]
		[Description("The width of the map in tiles")]
		public int Width
		{
			get { return DataContext.Width; }
			set
			{
				DataContext.Width = value;
				NotifyPropertyChanged();
			}
		}

		[Category("Appearence")]
		[DisplayName(@"Height")]
		[Description("The height of the map in tiles")]
		public int Height
		{
			get { return DataContext.Height; }
			set
			{
				DataContext.Height = value;
				NotifyPropertyChanged();
			}
		}

		[Category("Appearence")]
		[DisplayName(@"Tile Width")]
		[Description("The width of the individual tiles in pixels")]
		public int TileWidth
		{
			get { return DataContext.TileWidth; }
		}

		[Category("Appearence")]
		[DisplayName(@"Tile Height")]
		[Description("The height of the individual tiles in pixels")]
		public int TileHeight
		{
			get { return DataContext.TileHeight; }
		}

		public MapPropertyViewModel() {  }

		public MapPropertyViewModel(object map)
		{
			DataContext = (Map)map;
		}
	}
}
